package com.cbts.entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
/**
 * Hotel entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "hotel", catalog = "cbts",uniqueConstraints = @UniqueConstraint(columnNames = "hotel"))
public class Hotel implements java.io.Serializable {

	// Fields

	private Integer hotelId;
	private String hotel;
	private Double price;
	private Set<TravelStandard> travelStandards = new HashSet<TravelStandard>(0);

	// Constructors

	/** default constructor */
	public Hotel() {
	}

	/** minimal constructor */
	public Hotel(Integer hotelId, String hotel, Double price) {
		this.hotelId = hotelId;
		this.hotel = hotel;
		this.price = price;
	}

	/** full constructor */
	public Hotel(Integer hotelId, String hotel, Double price,
			Set<TravelStandard> travelStandards) {
		this.hotelId = hotelId;
		this.hotel = hotel;
		this.price = price;
		this.travelStandards = travelStandards;
	}

	// Property accessors
	@Id
	@Column(name = "hotelId", unique = true, nullable = false)
	@GeneratedValue(strategy = GenerationType.IDENTITY) 
	public Integer getHotelId() {
		return this.hotelId;
	}

	public void setHotelId(Integer hotelId) {
		this.hotelId = hotelId;
	}

	@Column(name = "hotel", unique = true, nullable = false, length = 25)
	
	public String getHotel() {
		return this.hotel;
	}

	public void setHotel(String hotel) {
		this.hotel = hotel;
	}

	@Column(name = "price", nullable = false, precision = 11)
	public Double getPrice() {
		return this.price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	@OneToMany( fetch = FetchType.LAZY, mappedBy = "hotel")
	public Set<TravelStandard> getTravelStandards() {
		return this.travelStandards;
	}

	public void setTravelStandards(Set<TravelStandard> travelStandards) {
		this.travelStandards = travelStandards;
	}

}